/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package feesmodule.converter;

import feesmodule.domain.Area;
import java.util.ArrayList;
import java.util.Collection;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Oleg
 */
@XmlRootElement(name="areas")
public class AreasConverter
{
    private Collection <Area> entities;
    private Collection <AreaConverter> items;

    public AreasConverter(Collection<Area> areas)
    {
        this.entities = areas;
        getArea();
    }
    public AreasConverter()
    {
    }

    @XmlElement
    public Collection<AreaConverter> getArea()
    {
        if(items == null)
            items = new ArrayList<AreaConverter>();
        if(entities != null)
        {
            items.clear();
            for(Area a: entities)
                items.add(new AreaConverter(a));
        }
        return items;
    }


    
}
